package com.gopay.common.domain.cust;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

/**
 * 实名认证日志记录表
 * 
 * @CustRealNameCertifyLog.java
 * @author wanggang
 * @2014-7-30 上午11:44:07  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "CUST_REAL_NAME_CERTIFY_LOG")
public class CustRealNameCertifyLog extends BaseEntity {

    private static final long serialVersionUID = 1991829347022183076L;
    //请求数据（含展示）
    private Long sq;
    private String custId;
    private String custName;
    private String certNo;
    private Date createdTs;
    private String certResult;
    private String failMessage;
    //响应数据
    private String orderId;
    private String resultCode;
    private String acceptTime;
    private String orderNo;
    private BigDecimal feeAmt;
    private String partnerID;
    private String charset;
    private String signType;
    private String remark;
    private String signMsg;
    private String channelCode;
    
    
    @Id
    @Column(name = "SQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CUST_REAL_NAME_CERTIFY_LOG_SEQ")
    @SequenceGenerator(name = "CUST_REAL_NAME_CERTIFY_LOG_SEQ", allocationSize = 1, initialValue = 1, sequenceName = "CUST_REAL_NAME_CERTIFY_LOG_SEQ")
    public Long getSq() {
        return sq;
    }

    public void setSq(Long sq) {
        this.sq = sq;
    }
    
    @Column(name = "CUST_ID", nullable = false, length = 10)
    public String getCustId() {
        return custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    @Column(name = "CUST_NAME", nullable = false, length = 150)
    public String getCustName() {
        //return custName;
        /**
         * modified by zyt 2017-4-10 自动重新加密并解密返回
         */
        this.custName = SensitiveInfoUtils.autoReencrypt(this.custName);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.custName);
    }

    public void setCustName(String custName) {
        //this.custName = custName;
        /**
         * modified by zyt 2017-4-10 写操作的时候做加密
         */
        this.custName = SensitiveInfoUtils.smartEncryptWithCheck(custName);
    }

    @Column(name = "CERT_NO", nullable = false, length = 150)
    public String getCertNo() {
        //return certNo;
        /**
         * modified by zyt 2017-4-10 自动重新加密并解密返回
         */
        this.certNo = SensitiveInfoUtils.autoReencrypt(this.certNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.certNo);
    }

    public void setCertNo(String certNo) {
        //this.certNo = certNo;
        /**
         * modified by zyt 2017-4-10 写操作的时候做加密
         */
        this.certNo = SensitiveInfoUtils.smartEncryptWithCheck(certNo);
    }

    @Column(name = "CREATED_TS", nullable = false)
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name = "CERT_RESULT", length = 10)
    public String getCertResult() {
        return certResult;
    }

    public void setCertResult(String certResult) {
        this.certResult = certResult;
    }

    @Column(name = "FAIL_MESSAGE", length = 250)
    public String getFailMessage() {
        return failMessage;
    }

    public void setFailMessage(String failMessage) {
        this.failMessage = failMessage;
    }

    @Column(name = "ORDER_ID", nullable = false, length = 32)
    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    @Column(name = "RESULT_CODE", length = 4)
    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    @Column(name = "ACCEPT_TIME", length = 14)
    public String getAcceptTime() {
        return acceptTime;
    }

    public void setAcceptTime(String acceptTime) {
        this.acceptTime = acceptTime;
    }

    @Column(name = "ORDER_NO", length = 32)
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Column(name = "FEE_AMT", precision = 20)
    public BigDecimal getFeeAmt() {
        return feeAmt;
    }

    public void setFeeAmt(BigDecimal feeAmt) {
        this.feeAmt = feeAmt;
    }

    @Column(name = "PARTNER_ID", length = 32)
    public String getPartnerID() {
        return partnerID;
    }

    public void setPartnerID(String partnerID) {
        this.partnerID = partnerID;
    }

    @Column(name = "CHARSET", length = 32)
    public String getCharset() {
        return charset;
    }

    public void setCharset(String charset) {
        this.charset = charset;
    }
    
    @Column(name = "SIGN_TYPE", length = 32)
    public String getSignType() {
        return signType;
    }

    public void setSignType(String signType) {
        this.signType = signType;
    }

    @Column(name = "REMARK",  length = 256)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(name = "SIGNMSG",  length = 256)
    public String getSignMsg() {
        return signMsg;
    }

    public void setSignMsg(String signMsg) {
        this.signMsg = signMsg;
    }

    @Column(name = "CHANNEL_CODE", length = 20)
	public String getChannelCode() {
		return channelCode;
	}

	public void setChannelCode(String channelCode) {
		this.channelCode = channelCode;
	}
    
    

}
